'use strict';

/* Services */

var iswitchServices = angular.module('iswitchServices', ['ngResource']);
//var iswitchServices = angular.module('iswitchServices',[]);

//iswitchServices.factory('directory', ['$resource',
 // function($resource){
   // return $resource('directory/:phoneId.json', {}, {
    //  query: {method:'POST', params:{phoneId:'directories'}, isArray:true}
   // });
 // }]);
var url ="http://194.90.90.222:8080/api/";
var urlgetdirectorylist =url+ 'getdirectorylist'; 
var urlgetdirectory =url+ 'getdirectory'; 
var urlupdatedirectory =url+ 'directory'; 

iswitchServices.factory('directory',function ($http, $location) {
    return {
        getDirectoryList: function (request){
                
            return $http.post(urlgetdirectorylist,request);
           
        }
//	getDirectoryList: function (request){
//	return $http.post(urlgetdirectorylist,request);
//	}
	,
        getdirectory: function (jsonrequest) {
            return $http.post(urlgetdirectory, jsonrequest);
        },
        delete: function (customer) {
            return $http.delete(url + customer.CustomerID);
        },
        update : function (directory) {
            return $http.post(urlupdatedirectory , directory);
        }
    };
});

